<?php
/**
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.cake.libs.view.templates.layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <?php echo $this->Html->charset(); ?>
  <title>
    <?php __('Centro de Idiomas Unillanos'); ?>
    <?php echo $title_for_layout; ?>
  </title>
  <?php
    echo $this->Html->meta('icon');
    //echo $this->Html->css('cake.generic');
    echo $this->Html->css('bootstrap');
	echo $this->Html->css('style');
    echo $this->Html->css('ciu');
		
	echo $this->Html->script('jquery1.9/jquery-1.9.0');
		echo $this->Html->script('jquery1.9/jquery.validate');
		echo $this->Html->script('jquery1.9/validator');	
		
    echo $scripts_for_layout;
  ?>
</head>
    <?php
	  //obtener los datos del usuario conectado.
      App::import('Component', 'Session');
      $mySession = new SessionComponent();
      $userInfo = $mySession->read('Auth.Ciuuser');
      $username=$userInfo['username'];
      $firstnames=$userInfo['first_names'];
    ?>
<body>
  <div class="fluxheader">
  <div class="container">
    <div id="header">
		<div class="row"> <!-- nav site top -->
					<div class="span12">
						<nav class="sitejump pull-right">
							<ul>
								 <?php if(isset($username)){ ?>
                                                                          <li><a href="/ciu/ciuusers/home">Inicio</a></li>
                                                                 <?php } ?>
                                                                        
								<?php if($firstnames !=""){ 	
                                                                                switch( $userInfo['ciuusertype_id'] ){ 
                                                                                        case 1:
                                                                                                ?><li><?php echo "<a href='/ciu/ciuusers/viewinfo'>".$firstnames ."</a>"; ?> </li> <?php
                                                                                                break;
                                                                                        case 2:
                                                                                                ?><li><?php echo "<a href='ciu/ciuusers/viewinfo'>".$firstnames ."</a>"; ?> </li> <?php
                                                                                                break;
                                                                                        case 3:
                                                                                                ?><li><?php echo "<a href='/ciu/ciuusers/changepass'>".$firstnames ."</a>"; ?> </li> <?php
                                                                                                break;
                                                                                        default:
                                                                                                echo "";  
                                                                                }
                                                                      }
                                                                else{ ?>
                                                                <li><a href="/ciu/ciuusers/login">Ingresar</a></li>
								<?php } ?>
                                                                
                                                                
							</ul>
						</nav>
					</div> <!-- end 12 -->
				</div> <!-- end row nav site top -->
				<div class="row banner">
							<center>
                                        <?php echo $this->Html->image('unillanosbanner.png'); ?>
                                    </center>
				
				
				</div> <!--end row banner -->
			</div>
	
			<div class="fluxnavcategory">  <!-- menu -->
				<div class="container">				
					<div class="row" style="margin-left: 0px;">
						<?php 
							if(isset($username)){ 	
								switch( $userInfo['ciuusertype_id'] ){ 
									case 1:
										echo $this->element("menu_student");
										break;
									case 2:
										echo $this->element("menu_teacher");
										break;
									case 3:
										echo $this->element("menu_admin");
										break;
									default:
										echo "";  
								}
							}
						?>
					</div> <!-- end row sitecategory -->
				</div> <!-- end container nav category -->
			</div> <!-- end flux nav category -->
		
    <div class="clearfix">&nbsp;</div> <!-- salto -->
	
    <?php echo $this->Session->flash(); ?> <!-- TODO alert -->
    
	<!-- contenido de la pagina -->
	<div class="container contentindex" >
			<div class="fluxappcontent">
				<div class="container">	
						<?php
							echo $content_for_layout;
						?>
				</div><!-- end container -->
			</div> <!-- end fluxappcontent -->
	</div> <!--end contentindex-->
	
	<div id="footerciu">
      <?php echo $this->Html->link(
          $this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework', true), 'border' => '0')),
          'http://www.cakephp.org/',
          array('target' => '_blank', 'escape' => false)
        );
      ?>
    </div>
	
		
  </div>
  </div>
</body>
</html>